<?php

class Rzd_Controller_Plugin_InitAcl extends Zend_Controller_Plugin_Abstract
{

    public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
    {
        $aclConfig = new Zend_Config_Ini(APPLICATION_PATH . '/configs/mvcacl.ini');
        $aclOptions = $aclConfig->toArray();

        $userDbMapper = new Default_Model_DbMapper_Users();

        $auth = Zend_Auth::getInstance();
        $authIdentity = $auth->getIdentity();

        $options = array(
            'userRoles' => $userDbMapper->getUserRoles(),
            'authIdentity' => $authIdentity,
            'aclRights' => $aclOptions['mvcacl']['rights']
        );
        $aclMvcManager = new Wlib_Acl_AclMvcManager($options);
    }
}
